<html>
    <head>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/css/admin_style.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/css/style.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/css2/base.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/css2/skeleton.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/css2/layout.css">
        <link rel="stylesheet" href="<?php echo base_url(); ?>/css/text.css">
        <link rel="stylesheet" href="<?php echo base_url(); ?>/css/registerform.css">
        <link rel="stylesheet" href="<?php echo base_url(); ?>/css2/trybutton.css">
    	<link rel="stylesheet" href="<?php echo base_url();?>/css2/slideshow.css">
		<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/css/table1.css">
    	<link rel="stylesheet" href="<?php echo base_url(); ?>/css/admin_panel_user.css">

        <!doctype html>
    <!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
    <!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
    <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
    <!--[if (gte IE 9)|!(IE)]><!--> 	<html lang="en"> <!--<![endif]-->
        <head>

            <!-- General Metas -->
            <meta charset="utf-8" />
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	<!-- Force Latest IE rendering engine -->
            <title>Edit User</title>
            <meta name="description" content="">
            <meta name="author" content="">
            <!--[if lt IE 9]>
                    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
            <![endif]-->

            <!-- Mobile Specific Metas -->
            <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> 
            <script language="javascript" type="text/javascript">
                function displayResult()
                {
                    var error;
                    if (document.getElementsByName('rank')[0].value == 'Select Rank')
                    {
                        window.alert("Please select a rank.");
                    }
                    else if (document.getElementsByName('myDate')[0].value == "")
                    {
                        window.alert("Please select a date.");
                    }
                    else if (document.getElementsByName('promotion')[0].value == 'Select Promotion')
                    {
                        window.alert("Please Select a promotion.");
                    }
                    else
                    {
                        var table = document.getElementById("myTable");
                        var row = table.insertRow(0);
                        var cell1 = row.insertCell(0);
                        var cell2 = row.insertCell(1);
                        var cell3 = row.insertCell(2);

                        cell1.innerHTML = document.getElementsByName('rank')[0].value;
                        cell2.innerHTML = document.getElementsByName('myDate')[0].value;
                        cell3.innerHTML = document.getElementsByName('promotion')[0].value;

                    }

                }


                function showAge()
                {
                    document.getElementById("age").style.display = "inline";
                    var jobValue = document.getElementsByName('bdate')[0].value;

                    var age;

                    var today = new Date();
                    var curr_date = today.getDate();
                    var curr_month = today.getMonth() + 1;
                    var curr_year = today.getFullYear();

                    var pieces = jobValue.split('-');
                    var birth_date = pieces[2];
                    var birth_month = pieces[1];
                    var birth_year = pieces[0];

                    if (curr_month == birth_month && curr_date >= birth_date) {
                        age = parseInt(curr_year - birth_year);
                    }
                    if (curr_month == birth_month && curr_date < birth_date)
                    {
                        age = parseInt(curr_year - birth_year - 1);
                    }

                    if (curr_month > birth_month) {
                        age = parseInt(curr_year - birth_year);
                    }

                    if (curr_month < birth_month)
                    {
                        age = parseInt(curr_year - birth_year - 1);
                    }

                    document.getElementById('ages').value = age;
                }


            </script>


        </head>

        <body>
        
         <div id="fb-root"></div>
		<script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) return;
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        
                <div id="" style="border:2px solid #FFF;
                border: 2px solid #FFF;
                position: absolute;
                width: 1050px;
                margin-left: 150px;
                margin-top: -8em;
                height: 1163px;
                background-color:#CCC;
                z-index: -60;-webkit-box-shadow: 0px 0px 10px rgba(50, 50, 50, 1);
                -moz-box-shadow:    0px 0px 10px rgba(50, 50, 50, 1);
                box-shadow:         0px 0px 10px rgba(50, 50, 50, 1); ">
                </div>
                
           
            
    <!----start of banner--->
    <div class="lo" style="background-image:url(<?php echo base_url(); ?>/images/wallpaper/Fotor1219134327.jpg);height: 218px;width: 1054px;margin-right: 145px;float: right; margin-top: -8em;">
    <div class="logo"> <img src="<?php echo base_url(); ?>/images/logo/image.gif"></div>
    <div style="float: left;margin-left: -339px;margin-top: 11em;color: white;font-family: monospace;font-size: small;">By: Grand Master Casimiro "CHINGI" Grandez</div>
    </div> <!----end of banner--->
    
     		<div id="menu">
                <?php $this->load->view('menu_view'); ?>
                <div id="logout">
                    <?php echo anchor("admin/home", "Logout"); ?>    
                </div>
            </div>
            

            <div class="clubwrapper">
                <div class="clubform">

                    <?php
                    extract($user);
                    ?>


                    <?php echo form_open('GSD_admin/edit_user/' . $user['userid'] . '/2') ?>

                    <?php echo validation_errors('<p class="error">'); ?>



                    <div class="leftside">

                        <div class="text5">Firstname: </div>
                        <?php echo form_input(array('name' => 'firstname', 'value' => $fname)); ?>

                        <div class="text5">Middlename:</div>       
                        <?php echo form_input(array('name' => 'middlename', 'value' => $mname)); ?>

                        <div class="text5">Lastname:</div>       
                        <?php echo form_input(array('name' => 'lastname', 'value' => $lname)); ?>

                        <div class="text5">Birthdate :</div> 		
                        <label for="mydate"></label>
                        <div class="mydate" style="margin-left: 46%;margin-top: -3em;">
                            <input name="bdate" style="margin-left:20px;" class="mydate" type="date" value="<?php echo $bdate ?>" data-role="datebox" data-options='{"mode":"calbox","useFocus": true}' onChange="showAge()">


                            <div id="age" style="display:none">
                                <div class="text5" style="margin-left: -40%;">Age :</div> 		
                                <?php echo form_input(array('name' => 'age', 'id' => 'ages', 'readonly' => 'true', 'style' => 'margin-left: 9%;')) ?>

                            </div>


                            <div class="text5" style="margin-left: -85%;">Email:
                                <?php echo form_input(array('name' => 'email', 'value' => $email)); ?>
                            </div>
                        </div><!--end leftside-->



                        <div class="user_add_rightside"><!------start user_add_rightside------->

                            <div class="text5">Username:</div>       
                            <?php echo form_input(array('name' => 'username', 'value' => $uname, 'readonly' => 'true')); ?>


                            <div class="text5">Password</div>
                            <?php echo form_password(array('name' => 'password', 'value' => $pword, 'readonly' => 'true')); ?>

                            <div class="text5">Role :</div>
                            <select name="roles">
                                <?php
                                foreach ($roles as $each) {
                                    echo '<option value="' . $each['name'] . '">' . $each['name'] . '</option>';
                                }
                                ?>
                            </select>

                            <div class="text5">Club:</div>
                            <div style="margin-top: -1.5em;">
                            <label>
                                <select>
                                    <option selected> Select Box </option>
                                    <option>Short Option</option>
                                    <option>This Is A Longer Option</option>
                                </select>
                            </label>     
                            </div>          

					
                            <div class="text5" style="margin-top: -1.5em;">Style:</div>
                            <?php echo form_input(array('name' => 'style', 'value' => $style)); ?>        
                        </div><!------end user_add_rightside------->


                        <div class="bottomoption_edit"><!--------------------------------------->

                            <div class="text5">Rank:</div>
                            <div class="box1">
                                <label>
                                    <select>
                                        <option value="">Select Rank</option>
                                        <option value="Bangladesh" <?php echo set_select('rank', '7th Class White Belt'); ?> >7th Class White Belt</option>
                                        <option value="India" <?php echo set_select('rank', '6th Class Green Belt'); ?> >6th Class Green Belt</option>
                                        <option value="Pakistan" <?php echo set_select('rank', '5th Class Brown Belt'); ?> >5th Class Brown Belt</option>
                                        <option value="Pakistan" <?php echo set_select('rank', '4th Class Brown Belt'); ?> >4th Class Brown Belt</option>
                                        <option value="Nepal" <?php echo set_select('rank', '3rd Class Red Belt'); ?> >3rd Class Red Belt</option>
                                        <option value="Bhutan" <?php echo set_select('rank', '2nd Class Red Belt'); ?> >2nd Class Red Belt</option>
                                        <option value="Srilanka" <?php echo set_select('rank', '1st Class Red Belt'); ?> >1st Class Red Belt</option> 
                                        <option value="Srilanka" <?php echo set_select('rank', '1st Dan Black Belt'); ?> >1st Dan Black Belt</option>
                                        <option value="Srilanka" <?php echo set_select('rank', '2nd Dan Black Belt'); ?> >2nd Dan Black Belt</option>
                                        <option value="Srilanka" <?php echo set_select('rank', '3nd Dan Black Belt'); ?> >3nd Dan Black Belt</option>
                                        <option value="Srilanka" <?php echo set_select('rank', '4th Dan Black Belt'); ?> >4th Dan Black Belt</option>
                                        <option value="Srilanka" <?php echo set_select('rank', '5th Dan Black Belt'); ?> >5th Dan Black Belt</option>
                                        <option value="Srilanka" <?php echo set_select('rank', '6th Dan Black Belt'); ?> >6th Dan Black Belt</option>
                                        <option value="Srilanka" <?php echo set_select('rank', '7th Dan Black Belt'); ?> >7th Dan Black Belt</option>
                                    </select>
                                </label>  
                            </div>  

                            <div style="margin-left: 223px;margin-top: -93px;">
                                <div class="text5">Exam:</div>
                                <div style="margin-left: -43px;margin-top: 0.7em;">
                                    <label for="mydate"></label>
                                    <input name="mydate" style="margin-left:20px;" class="mydate" type="date" data-role="datebox" data-options='{"mode":"calbox","useFocus": true}'>
                                </div>
                            </div>

                             <div class="firefoxbottomright1">
                                  <div class="text5" style="margin-left: 462px;margin-top: -5em;width: 200px;">Type of Promotion:</div>
                             </div>
                             
							<div style="margin-left: 344px;margin-top: 0.6em;">
                                <div class="firefoxbox3">
                                	<label>
									<select name="promotion">
										  <option selected> Select Promotion </option>
										  <option <?php echo set_select('rank', '7th Dan Black Belt'); ?> >Field Promotion</option>
										  <option <?php echo set_select('rank', '7th Dan Black Belt'); ?> >Exam Promotion</option>
									</select>
									</label>  
                                </div>
							</div> 
                            
                        </div><!----------end bottomoption----------------------------->

                        <div class="buttons" style="margin-top: 2em;margin-left: 292%;margin-bottom: 5em;">
                           <button id="addbtn" name="btnAdd" type="button" onClick="displayResult()">Add</button>
                        </div>

                    </div>




                  <!----start footer--------->
    <div style=" float: right;background: #006;margin-top: 8.9em;margin-right: -29px;width: 1054px;height: 96px;">
    	<div class="buttom_menu">
        <br/>
        <div style=""><?php echo anchor("GSD_admin/history","History"); ?></div> 
        <div style="margin-left: 50px;margin-top: -1.6em;"><?php echo anchor("GSD_admin/about_contact","About"); ?></div>    
        <div style="margin-left: 100px;margin-top: -3.3%;"><?php echo anchor("GSD_admin/about_contact","Contact Us"); ?></div>
        <div style="margin-left: 174px;margin-top: -1.6em;"> <a href="###">Shop</a></div>
        </div>
   		<br/><div style="font-family: monospace;color: white;font-size: 10px;margin-top: 0em;margin-left: 358px;">All Rights Reserved 2013. Copyright www.websiteurl.com</div>
 		<div style="font-family: monospace;color: white;font-size: 10px;margin-top: -1em;margin-left: 333px;">Develop by: Softbiz Global IT Solutions www.softbizglobal.com</div>
	</div>  <!----end footer--------->








                    <?php echo form_close() ?>


                    <!-- <div  class="footertext">
                     All Rights Reserved 2013. Copyright www.websiteurl.com
                     <br/>Develop by: Softbiz Global IT Solutions www.softbizglobal.com
                     </div>-->
                </div>
            </div>
            
            
            <div style="float:right; margin-right:154px; position: relative; top: -81.5em; width: 270px;height: 654px;border-left: 0px solid #FFF;padding-left:20px;-webkit-box-shadow: inset 5px 0px 5px -6px rgba(0,0,0,0.75);
        -moz-box-shadow: inset 5px 0px 5px -6px rgba(0,0,0,0.75);box-shadow: inset 5px 0px 5px -6px rgba(0,0,0,0.75);">
        
         <figure id="slider"><!--start slider--->
                <div class="container">
                    <img src="<?php echo base_url(); ?>/images2/1011886_495239593900308_116086745_n.jpg" alt="GAN SOO DO PHILIPPINES CENTRAL GYM">
                    <img src="<?php echo base_url(); ?>/images2/563339_486278894796378_51169551_n.jpg" alt="GRANDEZA VS MICOURIS FIGHT CANCELLED KO PROMOTIONS">
                    <img src="<?php echo base_url(); ?>/images2/996917_486278821463052_1958710513_n.jpg" alt="GRANDEZA VS MICOURIS">
                    <img src="<?php echo base_url(); ?>/images2/1011658_486278761463058_295778251_n.jpg" alt="GRANDEZA (PHI) VS OKINE (GHANNA)KO PROMOTION">
                </div>
                <figcaption></figcaption> <!-- slideshow caption -->
                <nav id="slider-nav"></nav> <!-- navigation -->
           		</figure>
                <script class="cssdeck" type="text/javascript" src="<?php echo base_url(); ?>/js/slideshow.js"></script> 
                	<div style="margin-left: -21px; margin-top: 1em;">	
                   <div class="fb-like-box" data-href="https://www.facebook.com/GanSooDoPhilippines" data-colorscheme="light" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false"></div>
               		</div>
                 
        </div>
        
        
        
        

        </body>
    </html>


